import { Entity, PrimaryGeneratedColumn, Column, OneToMany,  } from "typeorm";
import { ManualTimestamp } from "../decorators/manual-timestamp.decorator";
import { DeputyGeneralSkillLearned } from "./deputy-general-skill-learned.entity";

@Entity("skill_base")
@ManualTimestamp()
export class SkillBase {
  @PrimaryGeneratedColumn()
  id!: number;

  @Column({ type: "varchar", length: 100, unique: true })
  name!: string;

  @Column({ type: "int" })
  type!: number; // 技能类型(1:武士,2:文人,3:异师,0:特殊状态)

  @Column({ type: "int", default: 1 })
  side!: number; // 技能方向(1:攻击,2:防御)

  @Column({ type: "varchar", length: 10 })
  short!: string; // 技能简称

  @Column({ type: "varchar", length: 50, nullable: true })
  ani!: string; // 动画标识

  @Column({ type: "text", nullable: true })
  skill_descr!: string; // 技能详细描述

  @Column("datetime", { comment: "创建时间" })
  created_at!: Date;

  @Column("datetime", { comment: "更新时间" })
  updated_at!: Date;

  // @OneToMany(() => DeputyGeneralSkillLearned, (skillLearned) => skillLearned.skill)
  // learnedBy!: DeputyGeneralSkillLearned[];
}
